package com.bwf;

import com.bwf.map.Student;

import java.util.*;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/24 15:46
 * @Copyright 博为峰
 */
public class CollectionsDemo {
    public static void main(String[] args) {
        final ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("zhangsan", 20));
        students.add(new Student("lisi", 30));
        students.add(new Student("wangwu", 50));

        Collections.sort(students, new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                return o2.getAge() - o1.getAge();
            }
        });
//        System.out.println(students);

        final List<Integer> list = Arrays.asList(1, 2, 3);
    }
}
